<template>
  <div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            mValue: null
        }
    },
    props: {
        timestamp: Number
    },

    model:{
        prop: 'timestamp',
        event: 'change'
    },

    watch: {
        timestamp: function(v) {
            this.mValue = new Date(this.timestamp)
        }
    },

    methods: {
        change() {
            this.$emit('change', Math.ceil(this.mValue.getTime()))
        }
    },

    mounted() {
        if(this.timestamp) {
            this.mValue = new Date(this.timestamp)
        }
        else {
            
        }
    }

}
</script>

<style>

</style>